package com.example.framework.mqtt.emqx.properties;

import com.example.framework.mqtt.core.properties.MqttConfigProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

/**
 * <p>
 *      Emqx properties
 * </p>
 *
 * @author sfjiang
 * @since 2024/11/26 17:44
 */
@ConfigurationProperties(
        prefix = EmqxProperties.PREFIX
)
public class EmqxProperties {

    /**
     * 配置前缀
     */
    public static final String PREFIX = "ffc.mqtt.emqx";

    /**
     * 是否启用
     */
    private boolean enabled = false;
    /**
     * mqtt 基础配置
     */
    @NestedConfigurationProperty
    private MqttConfigProperties config;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public MqttConfigProperties getConfig() {
        return config;
    }

    public void setConfig(MqttConfigProperties config) {
        this.config = config;
    }
}
